import Mock from 'mockjs'

const Random = Mock.Random
export let userId = Random.integer(1, 100)
Mock.mock('/api/user/login', 'post', {
  "status": 0,
  "data": {
    "id": userId,
    "username": "@cname",
    "email": "@cname@51purse.com",
    "phone": null,
    "role": 0,
    "createTime": new Date().getTime(),
    "updateTime": new Date().getTime()
  }
})
Mock.mock('/api/user/logout', 'post', {
  "status": 0,
  "msg": "退出成功"
})
Mock.mock('/api/user/register', 'post', {
  "status": 0,
  "msg": "校验成功"
})
Mock.mock('/api/user', 'get', {
  "status": 0,
  "data": {
    "id": userId,
    "username": "@cname",
    "email": "@cname@163.com",
    "phone": null,
    "role": 0,
    "createTime": new Date().getTime(),
    "updateTime": new Date().getTime()
  }
})